package com.homework;

import java.util.Arrays;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/29 17:22
 * @description
 */
public class T2 {
    public static void main(String[] args) {
        String str = "svd9876fsb543fdg210";
        char[] chars = str.toCharArray();
        String temp = "";
        for (int i = 0; i < chars.length; i++) {
            if (chars[i]%2==0&&chars[i]!=48&&
                    chars[i]>=48&&chars[i]<=57){
                temp=temp+chars[i];
            }
        }
        int[] ou = new int[temp.length()];
        char[] chars1 = temp.toCharArray();
        for (int i = 0; i < temp.length(); i++) {
            ou[i] =Integer.parseInt(String.valueOf(chars1[i]));
        }
        for (int i = 0; i < ou.length; i++) {
            for (int j = 0; j < ou.length; j++) {
                if (ou[i]<ou[j]){
                    int t = ou[i];
                    ou[i] = ou[j];
                    ou[j] = t;
                }
            }
        }
        System.out.println(Arrays.toString(ou));
    }
}
